package com.tender.facade;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

// name 大写小写都ok
// @FeignClient(name = "SHIRO-NACOS-OPENFEIGN-SENTINEL-PROVIDER")

/**
 * name = "shiro-nacos-openfeign-sentinel-provider" 或者，需要和服务提供者的 spring.application.name 一样
 * name = "SHIRO-NACOS-OPENFEIGN-SENTINEL-PROVIDER" 大小写都可以
 * 注解 @FeignClient 这边不允许添加 @RequestMapping 注解
 * contextId = "providerServer" 对应于提供着的name @RestController("providerServer") 加不加都可以
 * 比如：
 * // @FeignClient(name = "shiro-nacos-openfeign-sentinel-provider",contextId = "providerServer")
 */
@FeignClient(name = "shiro-nacos-openfeign-sentinel-provider",
        fallbackFactory = StockFacadeSentinelFallBackFactory.class
        , fallback = StockFacadeSentinelFallBack.class
)
public interface StockFacadeSentinelApi {

    @GetMapping("/stock/{orderNo}")
    String deduceStockByOrderNo(@PathVariable String orderNo);


    @GetMapping("/check/stock/{stockNo}")
    String checkStockInfoByNo(@PathVariable String stockNo);

}
